package com.cgbg.controller;


import com.cgbg.pojo.Article;
import com.cgbg.service.ArticleService;
import com.cgbg.vo.Result;
import com.cgbg.vo.params.PageParams;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequiredArgsConstructor
@RequestMapping("articles")
public class ArticleController {

    private final ArticleService articleService;


    /**
     * 首页文章列表
     *
     * @param pageParams
     * @return
     */
    @PostMapping
    public Result listArticle(@RequestBody PageParams pageParams) {
        return articleService.listArticle(pageParams);
    }


}
